public class Main {

    public static void main(String[] args) {
        String hello = "Hello World!";
        System.out.println(Main.reverse(hello));
        System.out.println(hello.charAt(0));

        char[] as = hello.toCharArray();
        for (int i = as.length-1; i >= 0 ; i--) {
            System.out.print(as[i]);
        }
    }

    public static String reverse(String originStr) {
        if (originStr == null || originStr.length() <= 1){
            return originStr;
        }
        return reverse(originStr.substring(1)) + originStr.charAt(0);
    }
}
